\input ../../default-cn-cfg.mkvi

\starttext




%  单图 1
\chapter[title={单图 1-png}]
%%%  图片文件名 + 指定高度和宽度
\externalfigure[hehua.jpeg][width=6cm,height=5cm]
\input ../../hetangyuese/htys01.mkvi
\chapter[title={单图 1-pdf文件}]
%%%  pdf文件名 + 指定高度和宽度
\defineexternalfigure[youwentest][page=2,width=8cm,height=12cm]
\defineexternalfigure[youwenless][youwentest]
\setupexternalfigure [youwenless][page=1,
width=12cm,
height=17cm,
background=color,
backgroundcolor=gray,
frame=on,
]
\externalfigure[article.pdf][youwentest] % PDF 文件中的第2页
\externalfigure[article.pdf][youwenless]% PDF 文件中的第1页
%\input ../../hetangyuese/htys01.mkvi
\par \color[red]{整体嵌入pdf开始} \par
\startpagefigure[article.pdf][page=2]
\stoppagefigure
\startpagefigure[article.pdf][page=1,offset=5cm]offset=1cm,嵌入整页PDF
\stoppagefigure

\setcounter [userpage] [\pagenumber+2]%%因为增加的PDF,不增加页码,故手动调整页码
\color[red]{整体嵌入pdf结束}\par

\chapter[title={filterpages 添加PDF}]
\filterpages[article.pdf][1,2]%[width=18cm]


\chapter[title={externalfigure 添加tex动态生成的PDF}]
\defineexternalfigure[youwenPDFFromTex][background=color,
backgroundcolor=gray,
frame=on,]
\externalfigure[embeded.tex][youwenPDFFromTex]

\chapter[title={filterpages 嵌入方式添加PDF}]
\defineexternalfigure[inframe][option=frame,factor=fit]
\filterpages[article][odd][category=inframe]
\stoptext
